package com.xz.coursearrange.config;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;


/**
 * @Descripe: MybatisPlus配置类
 */
@MapperScan("com.xz.coursearrange.dao")
@EnableTransactionManagement  //自动管理事务
@Configuration
public class MybatisPlusConfig {

    // 分页插件
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        return new PaginationInterceptor();
    }

    // 逻辑删除插件,MP3.1之后不需要配置


    // 批量插入
//    @Bean
//    public InsertBatchSqlInjector easySqlInjector() {
//        return new InsertBatchSqlInjector();
//    }
//
//    @Bean
//    public GlobalConfig globalConfig(@Qualifier("easySqlInjector") ISqlInjector easySqlInjector){
//        GlobalConfig globalConfig = new GlobalConfig();
//        globalConfig.setSqlInjector(easySqlInjector);
//        return globalConfig;
//    }

}
